package com.DataWrapper;

import java.util.HashMap;
import java.util.Map;

public class MapData
{	private int id, typeId, mapLv, status, pointGoal;
	private Map<Integer,Integer> objGoal;
	private String name, curData, objects, goals;
	private int[] objID, objPercent;

	public MapData(int id, int typeId, int mapLv, String name, String data, String objects, String goals, int status)
	{	setId(id);setTypeId(typeId);setMapLv(mapLv);setStatus(status);
		setName(name);setCurData(data);setGoals(goals);
		
		String[] gs=goals.split(" ");
		setObjGoal(new HashMap<Integer,Integer>());
		setPointGoal(Integer.parseInt(gs[0]));
		int nObj = Integer.parseInt(gs[1]);
		int base=2;
		for (int i=0;i<nObj;i++)
			getObjGoal().put(Integer.parseInt(gs[base+2*i]), Integer.parseInt(gs[base+2*i+1]));
		
		String[] objs=objects.split(" ");
		nObj = Integer.parseInt(objs[0]);
		setObjID(new int[nObj]);
		setObjPercent(new int[nObj]);
		base = 1;
		for (int i=0;i<nObj;i++)
		{	objID[i]=Integer.parseInt(objs[base+2*i]);
			objPercent[i]=Integer.parseInt(objs[base+2*i+1]);
		}
	}
	public int getTypeId()
	{	return typeId;
	}
	public void setTypeId(int typeId)
	{	this.typeId = typeId;
	}
	public int getMapLv()
	{	return mapLv;
	}
	public void setMapLv(int mapLv)
	{	this.mapLv = mapLv;
	}
	public String getName()
	{	return name;
	}
	public void setName(String name)
	{	this.name = name;
	}
	public String getCurData()
	{	return curData;
	}
	public void setCurData(String data)
	{	this.curData = data;
	}
	private String getGoals()
	{	return goals;
	}
	private void setGoals(String goals)
	{	this.goals = goals;
	}
	public String getObjects()
	{	return objects;
	}
	public void setObjects(String objects)
	{	this.objects = objects;
	}
	public int getStatus()
	{	return status;
	}
	public void setStatus(int status)
	{	this.status = status;
	}
	public int getPointGoal()
	{
		return pointGoal;
	}
	private void setPointGoal(int pointGoal)
	{	this.pointGoal = pointGoal;
	}
	public Map<Integer,Integer> getObjGoal()
	{
		return objGoal;
	}
	private void setObjGoal(Map<Integer,Integer> objGoal)
	{	this.objGoal = objGoal;
	}
	public int getId()
	{	return id;
	}
	private void setId(int id)
	{	this.id = id;
	}
	public int[] getObjID()
	{	return objID;
	}
	private void setObjID(int[] objID)
	{
		this.objID = objID;
	}
	public int[] getObjPercent()
	{	return objPercent;
	}
	private void setObjPercent(int[] objPercent)
	{	this.objPercent = objPercent;
	}
}
